package com.bankcoder.operation;

import com.alibaba.excel.EasyExcel;
import com.bankcoder.entity.CheckResultEntity;

import java.util.List;

public class ExcelWriter {
    public static final String targetPath="G:\\cmpDemo\\a.xls";

    //第三步：调用方法进行写入
    public void writeExcelFirst(String sheetName, List list){
        EasyExcel.write(targetPath, CheckResultEntity.class).sheet(sheetName).doWrite(list);
    }

    public void writeExcelNotFirst(String filePath, String sheetName, List list){
        EasyExcel.write(filePath, CheckResultEntity.class).needHead(false).sheet(sheetName).doWrite(list);
    }

}
